PEG10data$SG_protein_tier_1 <- FALSE
PEG10data$SG_protein_tier_2 <- FALSE
PEG10data$SG_protein_tier_3 <- FALSE
# Finding genes that are significantly up or down and then conditionally formatting (transparent black- no hits, red - upregulated, blue - downregulated)
PEG10data$color[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "red"
PEG10data$alpha[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
PEG10data$color[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "blue"
PEG10data$alpha[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
# Comparing against SG data set and setting labels and point sizes based on tier
PEG10data$SG_protein_tier_1[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$SG_protein_tier_1[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$label[PEG10data$SG_protein_tier_1 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_1 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_1 == TRUE] <- 4
PEG10data$alpha[PEG10data$SG_protein_tier_1 == TRUE] <- 1
PEG10data$SG_protein_tier_2[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$SG_protein_tier_2[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$label[PEG10data$SG_protein_tier_2 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_2 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_2 == TRUE] <- 3
PEG10data$alpha[PEG10data$SG_protein_tier_2 == TRUE] <- 1
PEG10data$SG_protein_tier_3[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$SG_protein_tier_3[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$label[PEG10data$SG_protein_tier_3 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_3 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_3 == TRUE] <- 2
PEG10data$alpha[PEG10data$SG_protein_tier_3 == TRUE] <- 1
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 50000, color = PEG10data$color, size = 3.5) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Saving plot as .jpg
ggsave("PEG10_KO_vs_NTC", units="cm", width=15.5, height=15.5, dpi = 600)
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, color = PEG10data$color, size = 3.5) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, max.overlaps = Inf, color = PEG10data$color, size = 3.5) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, max.overlaps = Inf, color = PEG10data$color, size = 10) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, max.overlaps = Inf, color = PEG10data$color, size = 7) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, max.overlaps = Inf, color = PEG10data$color, size = 5) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Formatting for all data points
PEG10data$label <- ""
PEG10data$color <- "black"
PEG10data$alpha <- 0.1
PEG10data$point_size <- 1
PEG10data$point_shape <- 16
PEG10data$SG_protein_tier_1 <- FALSE
PEG10data$SG_protein_tier_2 <- FALSE
PEG10data$SG_protein_tier_3 <- FALSE
# Finding genes that are significantly up or down and then conditionally formatting (transparent black- no hits, red - upregulated, blue - downregulated)
PEG10data$color[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "red"
PEG10data$alpha[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
PEG10data$color[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "blue"
PEG10data$alpha[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
# Comparing against SG data set and setting labels and point sizes and shapes based on tier
PEG10data$SG_protein_tier_1[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$SG_protein_tier_1[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$label[PEG10data$SG_protein_tier_1 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_1 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_1 == TRUE] <- 4
PEG10data$point_shape[PEG10data$SG_protein_tier_1 == TRUE] <- 18
PEG10data$alpha[PEG10data$SG_protein_tier_1 == TRUE] <- 1
PEG10data$SG_protein_tier_2[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$SG_protein_tier_2[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$label[PEG10data$SG_protein_tier_2 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_2 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_2 == TRUE] <- 3
PEG10data$point_shape[PEG10data$SG_protein_tier_2 == TRUE] <- 17
PEG10data$alpha[PEG10data$SG_protein_tier_2 == TRUE] <- 0.7
PEG10data$SG_protein_tier_3[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$SG_protein_tier_3[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$label[PEG10data$SG_protein_tier_3 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_3 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_3 == TRUE] <- 2
PEG10data$point_shape[PEG10data$SG_protein_tier_3 == TRUE] <- 15
PEG10data$alpha[PEG10data$SG_protein_tier_3 == TRUE] <- 0.4
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size, shape = PEG10data$point_shape) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, max.overlaps = Inf, color = PEG10data$color, size = 5) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Formatting for all data points
PEG10data$label <- ""
PEG10data$color <- "black"
PEG10data$alpha <- 0.1
PEG10data$point_size <- 1
PEG10data$point_shape <- 16
PEG10data$SG_protein_tier_1 <- FALSE
PEG10data$SG_protein_tier_2 <- FALSE
PEG10data$SG_protein_tier_3 <- FALSE
# Finding genes that are significantly up or down and then conditionally formatting (transparent black- no hits, red - upregulated, blue - downregulated)
PEG10data$color[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "red"
PEG10data$alpha[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
PEG10data$color[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "blue"
PEG10data$alpha[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
# Comparing against SG data set and setting labels and point sizes and shapes based on tier
PEG10data$SG_protein_tier_1[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$SG_protein_tier_1[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$label[PEG10data$SG_protein_tier_1 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_1 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_1 == TRUE] <- 4
PEG10data$point_shape[PEG10data$SG_protein_tier_1 == TRUE] <- 18
PEG10data$alpha[PEG10data$SG_protein_tier_1 == TRUE] <- 1
PEG10data$SG_protein_tier_2[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$SG_protein_tier_2[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$label[PEG10data$SG_protein_tier_2 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_2 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_2 == TRUE] <- 3
PEG10data$point_shape[PEG10data$SG_protein_tier_2 == TRUE] <- 17
PEG10data$alpha[PEG10data$SG_protein_tier_2 == TRUE] <- 0.75
PEG10data$SG_protein_tier_3[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$SG_protein_tier_3[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$label[PEG10data$SG_protein_tier_3 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_3 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_3 == TRUE] <- 2
PEG10data$point_shape[PEG10data$SG_protein_tier_3 == TRUE] <- 15
PEG10data$alpha[PEG10data$SG_protein_tier_3 == TRUE] <- 0.5
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size, shape = PEG10data$point_shape) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, max.overlaps = Inf, color = PEG10data$color, size = 5) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Formatting for all data points
PEG10data$label <- ""
PEG10data$color <- "black"
PEG10data$alpha <- 0.1
PEG10data$point_size <- 1
PEG10data$point_shape <- 16
PEG10data$SG_protein_tier_1 <- FALSE
PEG10data$SG_protein_tier_2 <- FALSE
PEG10data$SG_protein_tier_3 <- FALSE
# Finding genes that are significantly up or down and then conditionally formatting (transparent black- no hits, red - upregulated, blue - downregulated)
PEG10data$color[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "red"
PEG10data$alpha[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
PEG10data$color[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "blue"
PEG10data$alpha[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
# Comparing against SG data set and setting labels and point sizes and shapes based on tier
PEG10data$SG_protein_tier_1[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$SG_protein_tier_1[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$label[PEG10data$SG_protein_tier_1 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_1 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_1 == TRUE] <- 7.5
PEG10data$point_shape[PEG10data$SG_protein_tier_1 == TRUE] <- 18
PEG10data$alpha[PEG10data$SG_protein_tier_1 == TRUE] <- 1
PEG10data$SG_protein_tier_2[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$SG_protein_tier_2[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$label[PEG10data$SG_protein_tier_2 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_2 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_2 == TRUE] <- 5
PEG10data$point_shape[PEG10data$SG_protein_tier_2 == TRUE] <- 17
PEG10data$alpha[PEG10data$SG_protein_tier_2 == TRUE] <- 0.75
PEG10data$SG_protein_tier_3[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$SG_protein_tier_3[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$label[PEG10data$SG_protein_tier_3 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_3 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_3 == TRUE] <- 2.5
PEG10data$point_shape[PEG10data$SG_protein_tier_3 == TRUE] <- 15
PEG10data$alpha[PEG10data$SG_protein_tier_3 == TRUE] <- 0.5
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size, shape = PEG10data$point_shape) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, max.overlaps = Inf, color = PEG10data$color, size = 5) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Formatting for all data points
PEG10data$label <- ""
PEG10data$color <- "black"
PEG10data$alpha <- 0.1
PEG10data$point_size <- 0.5
PEG10data$point_shape <- 16
PEG10data$SG_protein_tier_1 <- FALSE
PEG10data$SG_protein_tier_2 <- FALSE
PEG10data$SG_protein_tier_3 <- FALSE
# Finding genes that are significantly up or down and then conditionally formatting (transparent black- no hits, red - upregulated, blue - downregulated)
PEG10data$color[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "red"
PEG10data$alpha[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
PEG10data$color[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "blue"
PEG10data$alpha[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
# Comparing against SG data set and setting labels and point sizes and shapes based on tier
PEG10data$SG_protein_tier_1[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$SG_protein_tier_1[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$label[PEG10data$SG_protein_tier_1 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_1 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_1 == TRUE] <- 5
PEG10data$point_shape[PEG10data$SG_protein_tier_1 == TRUE] <- 18
PEG10data$alpha[PEG10data$SG_protein_tier_1 == TRUE] <- 1
PEG10data$SG_protein_tier_2[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$SG_protein_tier_2[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$label[PEG10data$SG_protein_tier_2 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_2 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_2 == TRUE] <- 2.5
PEG10data$point_shape[PEG10data$SG_protein_tier_2 == TRUE] <- 17
PEG10data$alpha[PEG10data$SG_protein_tier_2 == TRUE] <- 0.75
PEG10data$SG_protein_tier_3[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$SG_protein_tier_3[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$label[PEG10data$SG_protein_tier_3 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_3 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_3 == TRUE] <- 1.25
PEG10data$point_shape[PEG10data$SG_protein_tier_3 == TRUE] <- 15
PEG10data$alpha[PEG10data$SG_protein_tier_3 == TRUE] <- 0.5
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size, shape = PEG10data$point_shape) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, max.overlaps = Inf, color = PEG10data$color, size = 5) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Formatting for all data points
PEG10data$label <- ""
PEG10data$color <- "black"
PEG10data$alpha <- 0.1
PEG10data$point_size <- 1
PEG10data$point_shape <- 16
PEG10data$SG_protein_tier_1 <- FALSE
PEG10data$SG_protein_tier_2 <- FALSE
PEG10data$SG_protein_tier_3 <- FALSE
# Finding genes that are significantly up or down and then conditionally formatting (transparent black- no hits, red - upregulated, blue - downregulated)
PEG10data$color[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "red"
PEG10data$alpha[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
PEG10data$color[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "blue"
PEG10data$alpha[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
# Comparing against SG data set and setting labels and point sizes and shapes based on tier
PEG10data$SG_protein_tier_1[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$SG_protein_tier_1[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$label[PEG10data$SG_protein_tier_1 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_1 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_1 == TRUE] <- 6
PEG10data$point_shape[PEG10data$SG_protein_tier_1 == TRUE] <- 18
PEG10data$alpha[PEG10data$SG_protein_tier_1 == TRUE] <- 1
PEG10data$SG_protein_tier_2[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$SG_protein_tier_2[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$label[PEG10data$SG_protein_tier_2 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_2 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_2 == TRUE] <- 4
PEG10data$point_shape[PEG10data$SG_protein_tier_2 == TRUE] <- 17
PEG10data$alpha[PEG10data$SG_protein_tier_2 == TRUE] <- 0.75
PEG10data$SG_protein_tier_3[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$SG_protein_tier_3[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$label[PEG10data$SG_protein_tier_3 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_3 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_3 == TRUE] <- 2
PEG10data$point_shape[PEG10data$SG_protein_tier_3 == TRUE] <- 15
PEG10data$alpha[PEG10data$SG_protein_tier_3 == TRUE] <- 0.5
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size, shape = PEG10data$point_shape) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, max.overlaps = Inf, color = PEG10data$color, size = 5) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
# Formatting for all data points
PEG10data$label <- ""
PEG10data$color <- "black"
PEG10data$alpha <- 0.1
PEG10data$point_size <- 0.8
PEG10data$point_shape <- 16
PEG10data$SG_protein_tier_1 <- FALSE
PEG10data$SG_protein_tier_2 <- FALSE
PEG10data$SG_protein_tier_3 <- FALSE
# Finding genes that are significantly up or down and then conditionally formatting (transparent black- no hits, red - upregulated, blue - downregulated)
PEG10data$color[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "red"
PEG10data$alpha[PEG10data$Ratio > log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
PEG10data$color[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- "blue"
PEG10data$alpha[PEG10data$Ratio < -log2(2.00) & PEG10data$P_value > -log10(0.05)] <- 0.5
# Comparing against SG data set and setting labels and point sizes and shapes based on tier
PEG10data$SG_protein_tier_1[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$SG_protein_tier_1[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 1]
PEG10data$label[PEG10data$SG_protein_tier_1 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_1 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_1 == TRUE] <- 6.4
PEG10data$point_shape[PEG10data$SG_protein_tier_1 == TRUE] <- 18
PEG10data$alpha[PEG10data$SG_protein_tier_1 == TRUE] <- 1
PEG10data$SG_protein_tier_2[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$SG_protein_tier_2[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 2]
PEG10data$label[PEG10data$SG_protein_tier_2 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_2 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_2 == TRUE] <- 3.2
PEG10data$point_shape[PEG10data$SG_protein_tier_2 == TRUE] <- 17
PEG10data$alpha[PEG10data$SG_protein_tier_2 == TRUE] <- 0.75
PEG10data$SG_protein_tier_3[PEG10data$color == "red"] <- PEG10data$Gene[PEG10data$color == "red"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$SG_protein_tier_3[PEG10data$color == "blue"] <- PEG10data$Gene[PEG10data$color == "blue"] %in% SG_proteins$Protein[SG_proteins$Tier == 3]
PEG10data$label[PEG10data$SG_protein_tier_3 == TRUE] <- PEG10data$Gene[PEG10data$SG_protein_tier_3 == TRUE]
PEG10data$point_size[PEG10data$SG_protein_tier_3 == TRUE] <- 1.6
PEG10data$point_shape[PEG10data$SG_protein_tier_3 == TRUE] <- 15
PEG10data$alpha[PEG10data$SG_protein_tier_3 == TRUE] <- 0.5
# Creating volcano plot without grid highlighting all significantly changed data points
ggplot(PEG10data, aes(x = Ratio, y = P_value)) + removeGrid() +
# Dot plot
geom_point(color = PEG10data$color, alpha = PEG10data$alpha, size = PEG10data$point_size, shape = PEG10data$point_shape) +
# Drawing lines at 0 and other significant values
geom_hline(yintercept = -log10(0.05) , linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = -log2(2.00), linetype = "dotted", alpha = 0.6, size = 0.75) +
geom_vline(xintercept = 0, linetype = "dashed", size = 0.65) +
# To prevent text overlap with points, set label alpha, face and size
geom_text_repel(label = PEG10data$label, max.iter = 100000, max.overlaps = Inf, color = PEG10data$color, size = 5) +
# X-axis labels and ticks
scale_x_continuous(expression(log[2]~(PEG10~KO/NTC)),limits = c(-7,7), breaks = seq(-7,7,1), guide = guide_prism_minor()) +
# Y-axis labels and ticks
scale_y_continuous(expression(-log[10]~(adjusted~p-value)), limits = c(0,15), breaks = seq(0,15,5), guide = guide_prism_minor()) +
# Specifying axes thickness, label positions, axis label size, major and minor tick length and sizes, and plot size
theme(axis.line.x = element_line(color="black", size = 0.75), axis.title.x = element_text(vjust = 2, size = 20), axis.text = element_text(size = 17.5, face = "plain", color = "black"),
axis.line.y = element_line(color="black", size = 0.75), axis.title.y = element_text(vjust = -0.5, size = 20),
axis.ticks = element_line(size = 0.75), axis.ticks.length = unit(0.2,"cm"), prism.ticks.length = unit(0.15,"cm"),
panel.background = element_blank(), panel.border = element_blank(), plot.margin = unit(c(0.2, #top
0.15, #right
-0.3, #bottom
-0.25), #left
"cm"))
